$tiled-gallery-max-rounded-corners: 20;

.wp-block-jetpack-tiled-gallery {
	margin: 0 auto 1.5em;

	&.is-style-circle .gallery-item img {
		border-radius: 50%;
	}

	.tiled-gallery__gallery {
		width: 100%;
		padding: 0;
	}

	.gallery-container {
		display: flex;
		flex-wrap: wrap;
	}

	.gallery-item-wrapper {
		margin: 0;
		display: flex;
		flex-direction: column;
		flex-grow: 1;
		align-self: inherit;

		> img {
			background-color: color-mix(in srgb, var(--color-text) 10%, transparent);
		}

		> a,
		> a > img,
		> img {
			display: block;
			margin: 0;
			flex: 1 0 0%;
			object-fit: cover;
			object-position: center;
			padding: 0;
			width: 100%;
			height: 100%;
			max-width: 100%;
		}
	}

	.gallery-item {
		margin: 0 12px 12px 0;
		overflow: hidden;
		padding: 0;
		position: relative;
		display: flex;
		flex-grow: 1;
		justify-content: center;
		width: calc(50% - 6px);

		&:nth-child(2n) {
			margin-right: 0;
		}
	}
}
